package com.myapp.api.entity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

public class StudentCourseKey {
    private Integer id;

    @NotBlank(message = "学号不能为空")
    @Size(min = 2, max = 20, message = "学号长度在 2 到 20 之间")
    @Pattern(regexp = "^[1-9]\\d*$", message = "学号必须为数字")
    private String sid;

    @NotBlank(message = "课程编号不能为空")
    @Size(min = 2, max = 20, message = "课程编号长度在 2 到 20 之间")
    @Pattern(regexp = "^[1-9]\\d*$", message = "课程编号必须为数字")
    private String cid;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getSid() {
        return sid;
    }

    public void setSid(String sid) {
        this.sid = sid == null ? null : sid.trim();
    }

    public String getCid() {
        return cid;
    }

    public void setCid(String cid) {
        this.cid = cid == null ? null : cid.trim();
    }
}